
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<style>
    .p1{
        font-size: 20px;
        color: red;
    }
</style>
<body>
<h1>我的计算器</h1>
<form action="calculator2.jsp">
    <table>
        <tr>
            <td>请输入第一个数:</td>
            <td><input type="text" name="num1" value="<%
                String num01 = request.getParameter("num01");
                if (num01!=null && num01!=""){
                    out.print(num01);
                }
            %>"></td>
        </tr>
        <tr>
            <td>请选择运算方式</td>
            <td>
                <select name="fu">
                    <option>+</option>
                    <option>-</option>
                    <option>*</option>
                    <option>/</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>请输入第二个数:</td>
            <td><input type="text" name="num2" value="<%
                String num02 = request.getParameter("num02");
                if (num02!=null && num02!=""){
                    out.print(num02);
                }
            %>" ></td>
        </tr>
        <tr>
            <td colspan="2">
                <button type="submit">计算</button>
                <button type="reset">重置</button>
            </td>
        </tr>
        <tr>
            <td>结果:</td>
            <td><input type="text" name="num3" value="<%
                String jie = request.getParameter("jie");
                if (jie!=null && jie!=""){
                    out.print(jie);
                }
            %>"></td>
        </tr>
    </table>
<%
    String num1 = request.getParameter("no");
    if (num1!=null && num1!=""){%>
        <p class="p1"><%=num1%></p>
    <%}
%>

</form>
</body>
</html>
